﻿using System.Windows;
using System.Windows.Controls;
using Budgetsch.ViewModels.Costs;

namespace Budgetsch.Views.Costs
{
    public partial class CostDetailView : ChildWindow
    {
        private readonly CostDetailVMBase m_vm;

        public CostDetailView(CostDetailVMBase vm_)
        {
            m_vm = vm_;
            this.DataContext = vm_;
            InitializeComponent();

        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            dfCost.CommitEdit();
            m_vm.Commit();
            this.DialogResult = true;
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }
    }
}

